package com.mrc.core.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mrc.core.model.SysUser;
import com.mrc.core.service.SysUserService;

@Controller
@RequestMapping(value = "/sysUserController.do")
public class SysUserController {
    @Autowired
    private SysUserService sysUserService;

    /**
     * 列出所有正常状态的客户
     * @return
     */
    @ResponseBody
    @RequestMapping(params = "method=list")
    public JSONObject list() {
        Map<String, Object> reMap = new HashMap<String, Object>();
        List<SysUser> list = sysUserService.listAll();
        reMap.put("result", list);
        return JSONObject.fromObject(reMap);
    }

}
